{
Created: Thursday, October 27, 1988 at 10:07 PM
    Devices.p
    Pascal Interface to the Macintosh Libraries

    Copyright Apple Computer, Inc.   1985-1988
    All rights reserved
}


{$IFC UNDEFINED UsingIncludes}
{$SETC UsingIncludes := 0}
{$ENDC}

{$IFC NOT UsingIncludes}
    UNIT Devices;
    INTERFACE
{$ENDC}

{$IFC UNDEFINED UsingDevices}
{$SETC UsingDevices := 1}

{$I+}
{$SETC DevicesIncludes := UsingIncludes}
{$SETC UsingIncludes := 1}
{$IFC UNDEFINED UsingOSUtils}
{$I $$Shell(PInterfaces)OSUtils.p}
{$ENDC}
{$IFC UNDEFINED UsingFiles}
{$I $$Shell(PInterfaces)Files.p}
{$ENDC}
{$IFC UNDEFINED UsingQuickdraw}
{$I $$Shell(PInterfaces)Quickdraw.p}
{$ENDC}
{$SETC UsingIncludes := DevicesIncludes}

CONST
newSelMsg = 12;
fillListMsg = 13;
getSelMsg = 14;
selectMsg = 15;
deselectMsg = 16;
terminateMsg = 17;
buttonMsg = 19;
chooserID = 1;
initDev = 0;        {Time for cdev to initialize itself}
hitDev = 1;         {Hit on one of my items}
closeDev = 2;       {Close yourself}
nulDev = 3;         {Null event}
updateDev = 4;      {Update event}
activDev = 5;       {Activate event}
deactivDev = 6;     {Deactivate event}
keyEvtDev = 7;      {Key down/auto key}
macDev = 8;         {Decide whether or not to show up}
undoDev = 9;
cutDev = 10;
copyDev = 11;
pasteDev = 12;
clearDev = 13;
cdevGenErr = -1;    {General error; gray cdev w/o alert}
cdevMemErr = 0;     {Memory shortfall; alert user please}
cdevResErr = 1;     {Couldn't get a needed resource; alert}
cdevUnset = 3;      { cdevValue is initialized to this}


TYPE

DCtlPtr = ^DCtlEntry;
DCtlHandle = ^DCtlPtr;
DCtlEntry = RECORD
    dCtlDriver: Ptr;
    dCtlFlags: INTEGER;
    dCtlQHdr: QHdr;
    dCtlPosition: LONGINT;
    dCtlStorage: Handle;
    dCtlRefNum: INTEGER;
    dCtlCurTicks: LONGINT;
    dCtlWindow: WindowPtr;
    dCtlDelay: INTEGER;
    dCtlEMask: INTEGER;
    dCtlMenu: INTEGER;
    END;

AuxDCEPtr = ^AuxDCE;
AuxDCEHandle = ^AuxDCEPtr;
AuxDCE = PACKED RECORD
    dCtlDriver: Ptr;
    dCtlFlags: INTEGER;
    dCtlQHdr: QHdr;
    dCtlPosition: LONGINT;
    dCtlStorage: Handle;
    dCtlRefNum: INTEGER;
    dCtlCurTicks: LONGINT;
    dCtlWindow: GrafPtr;
    dCtlDelay: INTEGER;
    dCtlEMask: INTEGER;
    dCtlMenu: INTEGER;
    dCtlSlot: Byte;
    dCtlSlotId: Byte;
    dCtlDevBase: LONGINT;
    dCtlOwner: Ptr;
    dCtlExtDev: Byte;
    fillByte: Byte;
    END;



FUNCTION GetDCtlEntry(refNum: INTEGER): DCtlHandle;
FUNCTION SetChooserAlert(f: BOOLEAN): BOOLEAN;
FUNCTION OpenDriver(name: Str255;VAR drvrRefNum: INTEGER): OSErr;
FUNCTION CloseDriver(refNum: INTEGER): OSErr;
FUNCTION Control(refNum: INTEGER;csCode: INTEGER;csParamPtr: Ptr): OSErr;
FUNCTION Status(refNum: INTEGER;csCode: INTEGER;csParamPtr: Ptr): OSErr;
FUNCTION KillIO(refNum: INTEGER): OSErr;
FUNCTION PBControl(paramBlock: ParmBlkPtr;aSync: BOOLEAN): OSErr;
FUNCTION PBStatus(paramBlock: ParmBlkPtr;aSync: BOOLEAN): OSErr;
FUNCTION PBKillIO(paramBlock: ParmBlkPtr;aSync: BOOLEAN): OSErr;

{$ENDC}    { UsingDevices }

{$IFC NOT UsingIncludes}
    END.
{$ENDC}

